import dnsStatus from './dnsStatus';
const infoZH = {
  template: `
    <div>
      <div class="info-title">{{whois.domainName}} 的注册信息</div>
      <div class="info-time">以下信息获取时间：{{whois.cacheUpdatedDate}}</div>
      <div class="info-data">
        <table class="info-table">
          <tbody>
            <tr>
              <td><span class="label">域名所有者</span><span class="label">Registrant Name</span></td>
              <td>{{whois.registrantOrganization}}</td>
            </tr>
            <tr>
              <td><span class="label">所有者联系邮箱</span><span class="label">Registrant E-mail</span></td>
              <td>{{whois.registrantEmail}}</td>
            </tr>
            <tr>
              <td><span class="label">注册商</span><span class="label">Sponsoring Registrar</span></td>
              <td>{{whois.registrar}}</td>
            </tr>
            <tr>
              <td><span class="label">注册日期</span><span class="label">Registration Date</span></td>
              <td>{{whois.formatCreationDate}}</td>
            </tr>
            <tr>
              <td><span class="label">到期日期</span><span class="label">Expiration Date</span></td>
              <td>{{whois.formatExpirationDate}}</td>
            </tr>
            <tr>
              <td><span class="label">域名状态</span><span class="label">Domain Status</span></td>
              <td>
                <status :statusInfos="whois.statusInfos"></status>
              </td>
            </tr>
            <tr>
              <td><span class="label">DNS 服务器</span><span class="label">DNS Server</span></td>
              <td>
                <p v-for="item in whois.nameServers">{{item}}</p>
              </td>
            </tr>
          </tbody>
        </table>
      </div>
    </div>
  `,
  components: {
    'status': dnsStatus
  },
  props: ["infoZH"],
  data: function(){
    return {
      whois: ''
    }
  },
  watch: {
    infoZH(val){
      val.statusInfos = val.statusInfos[0];
      this.whois = val;
    }
  }
}
module.exports = infoZH;